const path = require("path");

function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = {
  publicPath: '/h5',
  outputDir: 'build/dist', // 构建时输出目录 默认dist
  // lintOnSave: process.env.NODE_ENV === 'development',
  lintOnSave: false,
  // 生产环境是否生成 sourceMap 文件
  productionSourceMap: false,
  // 开启 CSS source maps?
  css: {
    sourceMap: false,
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set("@", resolve("src"))
      .set("@/static", resolve("public"))
  },
  //跨域问题
  devServer: {
    disableHostCheck: true, //禁用主机检查 否则无法内网穿透
    proxy: {
      "/proxy": {
        target: "http://36.137.26.248:8083/",
        changeOrigin: true,
        pathRewrite: {
          "^/proxy": ""
        }
      }
    },
  }
}